# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
import objc
from GlyphsApp import *
from GlyphsApp.plugins import *
from itertools import combinations
import math


class Sharpangle(FilterWithoutDialog):
    @objc.python_method
    def settings(self):
        self.menuName = Glyphs.localize({'zh': '综艺创意黑变尖角'})


    @objc.python_method
    def filter(self, Layer,inEditView, customParameters):
        for path in Layer.paths:
            for path in Layer.paths:
                selectTool = NSClassFromString("GSToolSelect").alloc().init()
                print("path:", path)
                node_groups_2 = []
                for node in path.nodes:
                    if node.type == node.nextNode.type == "offcurve":
                        node_groups_2.append((node, node.nextNode))

                for node_group in node_groups_2:
                    selectTool._makeCorner_firstNodeIndex_endNodeIndex_(path, node_group[0].index, node_group[1].index)
    @objc.python_method
    def __file__(self):
        """Please leave this method unchanged"""
        return __file__